<template>
	<view>
		<view class="">
			<view class="list" v-for="(item,index) in data.rows" :key='index'>
				<view class="">
					<view class="imageBox">
						<image :src="baseURL+item.avatar"></image>
					</view>
					<view class="xx">
						<view class="name">{{item.name}}</view>
						<view class="zhiwei">{{item.detail}}</view>
					</view>
					<view class="select" @click="gopage('chat?name='+item.name+'&IMname='+item.account)">选择</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	import API from '../../common/api.js';
	export default {
		data() {
			return {
				baseURL:API.baseURL,
				data:[]
			}
		},
		onLoad() {
			// #ifdef APP-PLUS
			/* 隐藏凸起图标 */
			var icon = plus.nativeObj.View.getViewById("icon");
			setTimeout(function() {
				if(icon){icon.hide();}
			}, 100);
			// #endif
			this.zjZhuanjia();
		},
		methods: {
			gopage(e) {
				uni.navigateTo({
					url: e,
				});
			},
			zjZhuanjia(){
				var _this = this;
				uni.request({
					url:API.zjZhuanjia,
					method:"GET",
					header:API.get_head(),
					success: (res) => {
						_this.data = res.data;
						// console.log(_this.data)
					},
					fail: () => {
						uni.showToast({
							title:"加载失败",
							icon:'none'
						})
					}
				})
			}
		},
	}
</script>

<style>
.list{
	padding:20upx 25upx;
	display:flex;
	background:#FFFFFF;
	border:1upx solid #e5e5e5;
	position:relative;
}
.list:last-child{
	border:none;
}
.list>view{
	display: flex;
}
.list .imageBox{
	width:110upx;
	height:110upx;
}
.list .imageBox>image{
	width:110upx;
	height:110upx;
	border-radius: 50%;
}
.xx{
	padding:20upx 0 20upx 30upx;
}
.name{
	font-size:30upx;
	color:#333333;
	line-height:1;
}
.zhiwei{
	font-size:26upx;
	color:#818181;
	line-height:1;
	padding-top:10upx;
}
.select{
	position:absolute;
	top:40upx;
	right:25upx;
	color: #6aaff5;
	font-size:30upx;
}
</style>
